﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "GcmpPickInterface.h"
#include "IObject.h"

namespace gcmp {

    class IDocument;
    class IGraphicsElementShape;
    class IPickTarget;
    class IViewerContext;

    /// \brief 拾取上下文，是拾取的输入信息
    ///
    ///包括待拾取的Grep集合、视图信息、拾取设置选项等
    class GCMP_PICK_INTERFACE_EXPORT IPickContext : public IObject
    {
        DEFINE_CAST_DERIVED(gcmp::IPickContext, gcmp::IObject);
    public:
        /// \brief 设置当前文档
        /// \param pDocument 当前文档指针
        /// \return 成功返回true，失败返回false
        virtual bool SetDocument(const IDocument* pDocument) = 0;

        /// \brief 设置待拾取的GraphicsElementShape集合
        /// \param graphicsElementShapes 待拾取的GraphicsElementShape集合
        /// \return 成功返回true，失败返回false
        virtual bool SetGraphicsElementShapes(const std::vector<const IGraphicsElementShape*>& graphicsElementShapes) = 0;

        /// \brief 设置拾取目标
        /// \param pickTarget 拾取目标
        /// \return 成功返回true，失败返回false
        virtual bool SetPickTarget(OwnerPtr<IPickTarget> pickTarget) = 0;

        /// \brief 设置当前视图信息
        /// \param viewerContext 当前视图信息
        /// \return 成功返回true，失败返回false
        virtual bool SetViewerContext(OwnerPtr<IViewerContext> viewerContext) = 0;

        /// \brief 设置拾取面的方式，是否允许面内部拾取，如果不允许，则仅能靠面的边来拾取
        /// \param enable 是否允许通过面内部拾取面，默认为true，表示允许
        /// \return 成功返回true，失败返回false
        virtual bool SetSelectByFaceInteriorEnabled(bool enable) = 0;

        /// \brief 设置是否允许拾取高亮可见的图形结点
        /// \param enable 是否拾取高亮可见的图形结点，默认为false，表示不允许
        /// \return 成功返回true，失败返回false
        virtual bool SetAllowPickingHighlightOnlyGraphicsNode(bool isAllow) = 0;
    };

}// namespace gcmp

